import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		redirect: '/article/PHA-01',
	},
	{
		path: '/article/:gsbm',
		name: 'article',
		component: () => import('@/views/Article'),
	},
	{
		path: '/table/:gsbm',
		name: 'Table',
		component: () => import('@/views/Table/publicIndex.vue'),
	},
	{
		path: '/notationTable',
		name: 'NotationTable',
		component: () => import('@/views/Table/notationTable'),
	},
	{
		path: '/tableGrade46/:gsbm',
		name: 'TableGrade46',
		component: () => import('@/views/Table/tableGrade46.vue'),
	},
	{
		path: '/checkTable/:gsbm',
		name: 'CheckTable',
		component: () => import('@/views/Table/checkTable'),
	},
	{
		path: '/tables',
		name: 'Tables',
		component: () => import('@/views/Table/tables'),
	},
	{
		path: '/search',
		name: 'search',
		component: () => import('@/components/search.vue'),
	}
]

const router = new VueRouter({
	routes,
})

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch((err) => err)
}

export default router
